package com.misakyanls.examples.regexp;

import java.util.Scanner;

public class LoginCheck {

	public static boolean checkLogin(String login) {
		return login.matches("^([a-zA-Z]([a-zA-Z0-9\\.-]{0,18}[a-zA-Z0-9])?)$");
		
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.print("Enter login: ");
		System.out.println((checkLogin(in.nextLine()) ? "Correct" : "Wrong"));

	}
}
